/*
 * Author: http://www.redwolf-soft.com
 * All Rights Reserved
 * 
 * 2013.11
 *   
 * */
package com.redwolfsoft.libshoppingserver.datafetcher;

import java.util.ArrayList;
import java.util.List;



import com.redwolfsoft.libshoppingserver.brand.BrandAuthorizedShopInfo;
import com.redwolfsoft.libshoppingserver.brand.BrandInfo;
import com.redwolfsoft.libshoppingserver.brand.BrandShopInfo;
import com.redwolfsoft.libshoppingserver.brand.BrandShopArea;
import com.redwolfsoft.libshoppingserver.brand.BrandStoryInfo;
import com.redwolfsoft.libshoppingserver.brand.CommentInfo;
import com.redwolfsoft.libshoppingserver.brand.CountryCategory;
import com.redwolfsoft.libshoppingserver.brand.NewProductInfo;
import com.redwolfsoft.libshoppingserver.brand.RecommendCategoryInfo;
import com.redwolfsoft.libshoppingserver.favorite.FavoriteBrandItemInfo;
import com.redwolfsoft.libshoppingserver.favorite.FavoriteShoppingcenterItemInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterBrandInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterPromotionInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterShopFloorInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterShopInfo;



public class MockDataFetcher implements DataFetcher {

	String[] CountryArray = { "中国", "美国", "法国", "德国", "英国", "意大利", "日本",
			"澳大利亚", "比利时"

	};

	String[] BrandsArray = { "Dior", "Esprit", "VeroModa", "H&M", "Zara",
			"brandA", "brandB", "brandC", "", "", "", "" };
	// 定义url
	String WebBase = "http://192.168.1.233:8080/Web/picture/";
	// 图片名
	String[] BrandsPicFileNameArray = { "fb01.jpg", "fb02.jpg", "fb03.jpg",
			"fb04.jpg", "fb05.jpg", "fb06.jpg", "fb07.jpg", "fb08.jpg",
			"fb05.jpg", "fb06.jpg", "fb07.jpg", "fb08.jpg" };
	
	@Override
	public List<CountryCategory> getCountryCategoryBrandInfoList() {		
	
		

		List<CountryCategory> mCountryCategoryList = new ArrayList<CountryCategory>();

		// CountryArray 长度8
		for (int i = 0; i < CountryArray.length; i++) {
			ArrayList<BrandInfo> list = new ArrayList<BrandInfo>();
			// BrandsArray 长度8
			for (int j = 0; j < BrandsArray.length; j++) {

				// 点击首页中间图片进去-->网店:名字+网店url
				List<BrandAuthorizedShopInfo> mAuthorizedShopList = new ArrayList<BrandAuthorizedShopInfo>();

				for (int k = 0; k < 6; k++) {
					// Dior-0Authorized Shop0
					BrandAuthorizedShopInfo info = new BrandAuthorizedShopInfo(
							BrandsArray[j] + "-" + i + " Authorized Shop" + k,
							"http://www.eedata.cn/news/mainAction!main.action"
									+ k);
					mAuthorizedShopList.add(info);
				}
				// 保存一些专卖店和列表点进去的信息
				ArrayList<BrandShopInfo> list2 = new ArrayList<BrandShopInfo>();
				for (int l = 0; l < 8; l++) {
					BrandShopInfo info = new BrandShopInfo(i+"", "商场" + l, "专卖店"
							+ l, "Floor2", "长安街8号宇宙中心", "010-88888888", null
							,0.0,0.0);
					list2.add(info);
				}

				BrandInfo info = new BrandInfo((i * 100 + j)+"", BrandsArray[j],
						WebBase + BrandsPicFileNameArray[j],
						null,
						BrandsPicFileNameArray[j]
						  //,null				                 
						//,mAuthorizedShopList, list2
						);

				list.add(info);
			}
			
			CountryCategory c = new CountryCategory(i+"", CountryArray[i], list);
			mCountryCategoryList.add(c);
		}
		return mCountryCategoryList;
	}

	@Override
	public List<NewProductInfo> getNewProductInfoList(String brandid) {
		List<NewProductInfo> mList = new ArrayList<NewProductInfo>();
		
		String WebBase = "http://192.168.1.233:8080/Web/picture/";
		String[] ProductsFileNameArray = { "fb01.jpg", "fb02.jpg", "fb03.jpg",
				"fb04.jpg", "fb05.jpg", "fb06.jpg", "fb07.jpg", "fb08.jpg" };
		// String[] resTextArray =
		// getResources().getStringArray(R.array.array_characterType);

		for (int i = 0; i < ProductsFileNameArray.length; i++) {
			NewProductInfo info = new NewProductInfo(
					i+"",
					"newproduct" + i,
					WebBase + ProductsFileNameArray[i],
					null,
					ProductsFileNameArray[i], 0, 0, WebBase
							+ ProductsFileNameArray[i], "big-"
							+ ProductsFileNameArray[i]);
			mList.add(info);
		}
		return mList;
	}

	@Override
	public List<BrandShopArea> getBrandShopAreaList(String countryid, String brandid
			,double longitide, double latitude, int page) {

		List<BrandShopArea> mList = new ArrayList<BrandShopArea>();

		// CountryArray 长度8
		for (int i = 0; i < CountryArray.length; i++) {
			// 保存一些专卖店和列表点进去的信息
			ArrayList<BrandShopInfo> list2 = new ArrayList<BrandShopInfo>();
			for (int l = 0; l < 8; l++) {
				BrandShopInfo info = new BrandShopInfo(l+"", brandid+"商场" + l, "专卖店"
						+ l, "Floor2", "长安街8号宇宙中心", "010-88888888", null
						,0.0,0.0);
				list2.add(info);
			}
			BrandShopArea c = new BrandShopArea(i+"", CountryArray[i], list2);
			mList.add(c);
				
		}
			
		return mList;
	}

	@Override
	public List<CommentInfo> getBrandReviewInfoList(String brandid) {
		List<CommentInfo> mList = null;
		String[]userArray = new String[]{"user1", "", "user2", "user3", 
				"user4", "user5",
				"user6", "user7"};	
	String[]msgArray = new String[]{
			"Interface definition for a callback to be invoked when a child in this expandable list has been clicked. ",
		 "Used for being notified when a group is collapsed ",
		 "我也有",
		 "那上吧", 
				"Used for being notified when a group is expanded ",
				"Used for being notified when a group is expanded ",
				"Used for being notified when a group is expanded  "};

	String[]dateArray = new String[]{"2012-09-01 18:00", "2012-09-01 18:10", 
				"2012-09-01 18:11", "2012-09-01 18:20", 
				"2012-09-01 18:30", "2012-09-01 18:35", 
				"2012-09-01 18:40", "2012-09-01 18:50"}; 
	
	mList = new ArrayList<CommentInfo>();
	for(int i=0;i<msgArray.length;i++)
	{
		CommentInfo info = new CommentInfo(userArray[i],dateArray[i],msgArray[i]);
		mList.add(info);
	}
		return mList;
	}

	@Override
	public List<ShoppingCenterInfo> getShoppingCenterInfoList(int type,
			double longititue,double latitude, String address, int page,String userid) {
		 List<ShoppingCenterInfo> mList = new ArrayList<ShoppingCenterInfo>();
		for(int i=0;i<5;i++)
		{/*
			List<ShoppingCenterBrandInfo> list = new ArrayList<ShoppingCenterBrandInfo>();
			for(int j=0;j<6;j++)
			{
				ShoppingCenterBrandInfo brand = 
					new ShoppingCenterBrandInfo(i*100+j,"Brand in ShoppingCenter"+j,"address"+j);
				list.add(brand);
			}
			
			List<ShoppingCenterShopInfo> list2 = new ArrayList<ShoppingCenterShopInfo>();
			for(int l=0;l<6;l++)
			{
				ShoppingCenterShopInfo brand = 
					new ShoppingCenterShopInfo("ShoppingCenter Shop"+i+"-"+l,l);
				list2.add(brand);
			}
			*/
			ShoppingCenterInfo info = new ShoppingCenterInfo(i+"",
					"ShoppingCenter"+i,"subname"+i,false
					//,list,list2
					);
			
			info.longititude=116.374252;
			info.latitude=40.019561;
			info.address = "五道口宇宙中心";
			info.email = "service@paskon.com";
			info.tel = "400-1234-5678";
			info.serviceSlot = "Available 9:00~18:00";
			
			mList.add(info);
			
			
		}
		return mList;
	}


	@Override
	public List<BrandAuthorizedShopInfo> getAuthorizedBrandEShopInfoList(
			String brandid) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean addReview(String user, String deviceId, String review,
			String brandid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public List<ShoppingCenterPromotionInfo> getShoppingCenterPromotionInfoList(
			String shoppingcenterId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<ShoppingCenterShopInfo> getShoppingCenterShopInfoList(
			String shoppingcenterId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<ShoppingCenterBrandInfo> getShoppingCenterBrandInfoList(
			String shoppingcenterId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<FavoriteShoppingcenterItemInfo> getFavoritedShoppingCenterList(String user,
			String deviceId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<FavoriteBrandItemInfo> getFavoritedBrandInfoList(String user,
			String deviceId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public BrandStoryInfo getBrandStoryInfo(String brandid) {
		// TODO Auto-generated method stub
		return null;
	}



	@Override
	public List<ShoppingCenterShopFloorInfo> getShoppingCenterShopFloorInfoList(
			String shoppingcenterid) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean registerNewUser(String user, String passwd, String deviceid,
			String email, String mobile, String gender, String birthdate) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public String login(String email, String passwd, String deviceid) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean logout(String userid, String passwd, String deviceid) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean addStoryComment(String userid, String deviceid,
			String review, String storyid) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public List<CommentInfo> getStoryCommentInfoList(String brandid) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean applaudNewProduct(String newproductid, String userid) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean addFeedback(String userid, String deviceid, String feedback,
			String qq) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public List<BrandShopInfo> getBrandShopInfoList(String address,double longitide, double latitude, int page) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean favoriteShoppingCenter(String userid, String deviceid,
			String shoppingcenterid) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean favoriteBrand(String userid, String deviceid, String brandid) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isFavoriteBrand(String userid, String deviceid,
			String brandid) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isFavoriteShoppingCenter(String userid, String deviceid,
			String shoppingcenterid) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean cancelFavoriteBrand(String userid, String deviceid,
			String brandid) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean cancelFavoriteShoppingcenter(String userid, String deviceid,
			String shoppingcenterid) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isApplaudNewProduct(String userid, String deviceid,
			String newproductId) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public List<RecommendCategoryInfo> getRecommendCategoryInfo(
			double longitide, double latitude, int page,String userid) {
		// TODO Auto-generated method stub
		return null;
	}

}
